package com.zr.model;
// Generated 2016-6-19 19:35:13 by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * TFunc generated by hbm2java
 */
@Entity
@Table(name = "t_func", catalog = "ld_sys")
public class TFunc implements java.io.Serializable {

	private Integer fid;
	private String fname;
	private Integer parentid;
	private String fstate;
	private String fpath;
	private Set<TRole> TRoles = new HashSet<TRole>();

	public TFunc() {
	}

	public TFunc(String fname, Integer parentid, String fstate, String fpath, Set<TRole> TRoles) {
		this.fname = fname;
		this.parentid = parentid;
		this.fstate = fstate;
		this.fpath = fpath;
		this.TRoles = TRoles;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "fid", unique = true, nullable = false)
	public Integer getFid() {
		return this.fid;
	}

	public void setFid(Integer fid) {
		this.fid = fid;
	}

	@Column(name = "fname")
	public String getFname() {
		return this.fname;
	}

	public void setFname(String fname) {
		this.fname = fname;
	}

	@Column(name = "parentid")
	public Integer getParentid() {
		return this.parentid;
	}

	public void setParentid(Integer parentid) {
		this.parentid = parentid;
	}

	@Column(name = "fstate")
	public String getFstate() {
		return this.fstate;
	}

	public void setFstate(String fstate) {
		this.fstate = fstate;
	}

	@Column(name = "fpath")
	public String getFpath() {
		return this.fpath;
	}

	public void setFpath(String fpath) {
		this.fpath = fpath;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TFuncs")
	public Set<TRole> getTRoles() {
		return this.TRoles;
	}

	public void setTRoles(Set<TRole> TRoles) {
		this.TRoles = TRoles;
	}

}
